package pap.gui;

import java.awt.Color;
import java.awt.Graphics;

import pap.Point;
import pap.utils.Constants;

public class BodyCircle implements IShape {

	private double radius;
	private Point center;

	/**
	 * Creation of the body's shape that will be visualized on the screen
	 * 
	 * @param center
	 * @param radius
	 */
	public BodyCircle(Point center, double radius) {
		this.center = center;
		this.radius = radius;
	}

	/**
	 * Draws the shape that represent the body on the screen
	 */
	@Override
	public void draw(Graphics g) {

		int xCenter = (int) center.getCoordinate(0);
		int yCenter = (int) center.getCoordinate(1);
		int r = (int) radius;

		g.setColor(Color.YELLOW);
		g.drawOval(xCenter - r, yCenter - r, 2 * r, 2 * r);
		g.setColor(Constants.BODY_COLOR);
		g.fillOval(xCenter - r, yCenter - r, 2 * r, 2 * r);

	}
}